home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 24
/
AMIGAplus Sonderheft 24 (2000)(Falke)(DE)[!].iso
/
PublicDomain
/
Anwendungen
/
MT-RechnungIII
/
Rexx
/
FWPaketkarteNN+Z.outrexx
< prev
next >
Wrap
Text File
|
1998-11-17
|
5KB
|
221 lines
/*
** Druck-, Vorschau, Sichern der Nachnahme Paketkarte mit Zahlschein zur Rechnung mit Hilfe von FinalWriter
** $VER: FWPaketkarteNN+Z.outrexx V1.00 (17.11.98)
*/
PARSE ARG ARexxPort;
ADDRESS VALUE ARexxPort;
OPTIONS RESULTS;
FWVorlage = "FWDokumente/PaketkarteNN+Z.fw";
FWDokument = "t:PaketkarteNN+Z.fw";
FWPort = "FINALW."
LF = '0a'x; /* Zeilenvorschub */
Gefunden = 0;
DO i = 1 TO 20 WHILE(Gefunden = 0)
IF show(ports, (FWPort || i)) THEN
DO;
Gefunden = 1;
FWPort = FWPort || i;
END;
END;
IF Gefunden = 0 THEN
DO;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "FinalWriter ist nicht aktiv, bitte starten sie dieses" || LF || "und versuchen Sie es erneut";
ES_GADGETFORMAT = "Abbrechen";
EASY_REQUEST;
EXIT;
END;
/* Original FW-Dokument nach t: kopieren, um ein versehentliches überschreiben */
/* dieser Vorlage zu verhindern */
GET_REXXPATH;
FWVorlage = MTR_RESULT || FWVorlage;
ADDRESS COMMAND "copy" FWVorlage FWDokument;
/* Oberfläche sperren */
LOCKGUI;
/* Art ermitteln: 0 = Drucken, 1 = Vorschau, 2 = Speichern */
PRINTSTATE;
Druckart = MTR_RESULT;
Ende_Kennzeichen = 'N';
/* Suchen der zu druckenden Daten */
GET_PREFS;
PRINTFIND;
DO WHILE( MTR_RESULT > 0 & Ende_Kennzeichen = 'N');
ADDRESS VALUE FWPort;
SCREENTOFRONT;
CALL DatenAufbereiten;
SELECT;
WHEN Druckart = 0 THEN /* Drucken */
DO;
ADDRESS VALUE FWPort;
PRINT;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
WHEN Druckart = 1 THEN /* Vorschau */
ADDRESS VALUE ARexxPort;
WHEN Druckart = 2 THEN /* Sichern */
DO;
ADDRESS VALUE FWPort;
SAVEAS;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
OTHERWISE
DO;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "Druckart wird nicht unterstützt!";
ES_GADGETFORMAT = "Ok";
EASY_REQUEST;
Ende_Kennzeichen = 'J';
END;
END;
PRINTFIND;
END;
/* WordWorth-Datei aus t: wieder entfernen */
ADDRESS COMMAND "delete" FWDokument;
/* Oberfläche wieder entsperren */
ADDRESS VALUE ARexxPort;
FREEGUI;
EXIT;
DatenAufbereiten:
ADDRESS VALUE ARexxPort;
IF PREFS.NUMBER_DIGITS > 0 THEN
ZW_Rechnung = RIGHT( (Copies("0",PREFS.NUMBER_DIGITS) || MTR_RESULT), PREFS.NUMBER_DIGITS );
ELSE
ZW_Rechnung = MTR_RESULT;
NAME_OF_SALUTATION OB.INVOICEE.CUSTOMER.ADDRESS.SALUTATION;
ZW_Anrede = MTR_RESULT;
/* Betrag korrekt formatieren, Währungssymbol separieren */
i = OB.CURRENCY_USED;
FORMAT_MONEY2 OB.TOTAL_ADD_M_ALL_CH.i;
j = index( MTR_RESULT, PREFS.CURRENCYSYMBOL );
l1 = j - 1;
l2 = LENGTH( MTR_RESULT ) - l1 - LENGTH( PREFS.CURRENCYSYMBOL );
IF i < 2 THEN
FORMAT_MONEY1 OB.TOTAL_ADD_M_ALL_CH.i;
ZW_Betrag = LEFT(MTR_RESULT, l1) || RIGHT(MTR_RESULT, l2);
ZW_WSymbol = SUBSTR(MTR_RESULT, j, (LENGTH( MTR_RESULT ) - l1 - l2) );
/* Betrag korrekt formatieren (Zahlschein)*/
FORMAT_MONEY2 OB.TOTAL_M_ALL_CH.i;
j = index( MTR_RESULT, PREFS.CURRENCYSYMBOL );
l1 = j - 1;
l2 = LENGTH( MTR_RESULT ) - l1 - LENGTH( PREFS.CURRENCYSYMBOL );
IF i < 2 THEN
FORMAT_MONEY1 OB.TOTAL_M_ALL_CH.i;
ZW_BetragZS = LEFT(MTR_RESULT, l1) || RIGHT(MTR_RESULT, l2);
IF PREFS.CLIENT_CODE = 1 THEN
ZW_Kunde = OB.INVOICEE.CUSTOMER.CLIENT_CODE;
ELSE IF PREFS.NUMBER_DIGITS > 0 THEN
ZW_Kunde = RIGHT( (Copies("0",PREFS.NUMBER_DIGITS) || OB.INVOICEE_NUMBER), PREFS.NUMBER_DIGITS );
ELSE
ZW_Kunde = OB.INVOICEE_NUMBER;
ADDRESS VALUE FWPort;
CLEARDOC;
OPEN FWDokument;
IF OB.OFFICE.ADDRESS.COMPANY1 > "" THEN
ZW_Adresse = OB.OFFICE.ADDRESS.COMPANY1;
ELSE
ZW_Adresse = OB.OFFICE.ADDRESS.PRENAME OB.OFFICE.ADDRESS.SURNAME;
FIND "<SENDER.SUR_PREN>"
FINDNEXT;
TYPE ZW_Adresse;
FINDNEXT;
TYPE ZW_Adresse;
MoveToLine 1 1;
FIND "<SENDER.STREET>";
TYPE OB.OFFICE.ADDRESS.STREET;
FIND "<SENDER.ZIP>";
TYPE OB.OFFICE.ADDRESS.ZIP;
FIND "<SENDER.CITY>";
TYPE OB.OFFICE.ADDRESS.CITY;
FIND "<OB.TOTAL>";
TYPE ZW_Betrag;
FIND "<SENDER.ACCOUNT>";
TYPE OB.OFFICE.ADDRESS.ACCOUNT;
FINDNEXT;
TYPE OB.OFFICE.ADDRESS.ACCOUNT;
MoveToLine 1 1;
FIND "<RECEIVER.SALUTATION>";
TYPE ZW_Anrede;
FIND "<SENDER.BANK_SHORT>";
TYPE OB.OFFICE.ADDRESS.BANK_SHORT;
IF OB.INVOICEE.CUSTOMER.ADDRESS.COMPANY1 > "" THEN
ZW_Adresse = OB.INVOICEE.CUSTOMER.ADDRESS.COMPANY1;
ELSE
ZW_Adresse = OB.INVOICEE.CUSTOMER.ADDRESS.PRENAME OB.INVOICEE.CUSTOMER.ADDRESS.SURNAME;
FIND "<RECEIVER.SUR_PRENAME>";
TYPE ZW_Adresse;
FINDNEXT;
TYPE LEFT((ZW_Adresse || ", " || OB.INVOICEE.CUSTOMER.ADDRESS.CITY), 27);;
MoveToLine 1 1;
FIND "<S.BANK_C_NR>";
TYPE OB.OFFICE.ADDRESS.BANK_CODE_NUMBER;
FIND "<S.BCM>";
TYPE OB.OFFICE.ADDRESS.BANK_CODE_NUMBER;
MoveToLine 1 1;
FIND "<RECEIVER.STREET>";
TYPE OB.INVOICEE.CUSTOMER.ADDRESS.STREET;
FIND "<R.ZIP>";
TYPE OB.INVOICEE.CUSTOMER.ADDRESS.ZIP;
FIND "<RECEIVER.CITY>";
TYPE OB.INVOICEE.CUSTOMER.ADDRESS.CITY;
FIND "<SENDER.BANK_NAME>";
TYPE LEFT(OB.OFFICE.ADDRESS.BANK_NAME,27);
FIND "<B.TOTAL>";
TYPE ZW_BetragZS;
FINDNEXT;
TYPE ZW_BetragZS;
MoveToLine 1 1;
FIND "<W>";
TYPE ZW_WSymbol;
FIND "<B.BILL_NUMBER>";
TYPE ZW_Rechnung;
FIND "<SEND.NUMBER>";
TYPE ZW_Kunde;
RETURN;